Skip to content

M12 Domain Name System - DNS

Back to the Course Schedule

ENABLE THE ENGLISH SUBTITLES, These videos are spoken in Finnish

Lecture Videos

Video: Data Networks, Domain Name System - DNS , part 1

Video: Data Networks, Domain Name System - DNS , part 2

The basics

Domain Name System is a

  1. a collection of distributed and structured databases containing records of data (typically domain names, ipv4 addresses) - (DNS SERVERS)
  2. a query mechanism to resolve these data fields called records - (DNS QUERIES)

Example of a record: student.labranet.jamk.fi -> 195.148.26.130

!a

Standardization

DNS is standardized through:

But there are a lot of updates to the previously mentioned RFC's throughout the years. The basics are still the same.

DNS Hierarchy

Domain names grow hierarchically:

  • record.subdomain.domain.TLD.
  • student.labranet.jamk.fi.

Note! the last dot . is typically not represented in graphical user interfaces (like browsers).

!a

Testing DNS on your local computer?

These videos are still in Finnish

Video: Data Networks, Domain Name System - DNS , part 2

Very easy with nslookup -command and Command Prompt / Terminal -software:

nslookup student.labranet.jamk.fi

Microsoft Windows [Version 10.0.18363.1139]
(c) 2019 Microsoft Corporation. All rights reserved.

C:\Users\sahka>nslookup student.labranet.jamk.fi
Server:  raspberrypi
Address:  192.168.0.253

Non-authoritative answer:
Name:    student.labranet.jamk.fi
Address:  195.148.26.130

Thus student.labranet.jamk.fi -record points to an IPv4 address of 195.148.26.130.

Which is the IP address of the webserver at our Labranet, and which holds & hosts e.g. your Web techniques -course web pages.

Other examples:

nslookup www.google.fi
C:\Users\sahka>nslookup www.google.fi
Server:  raspberrypi
Address:  192.168.0.253

Non-authoritative answer:
Name:    www.google.fi
Addresses:  2a00:1450:400f:806::2003
          172.217.20.35
nslookup www.ilta-sanomat.fi
C:\Users\sahka>nslookup www.ilta-sanomat.fi
Server:  raspberrypi
Address:  192.168.0.253

Non-authoritative answer:
Name:    redirect.sanoma.fi
Address:  158.127.161.73
Aliases:  www.ilta-sanomat.fi
nslookup whitehouse.gov
C:\Users\sahka>nslookup whitehouse.gov
Server:  raspberrypi
Address:  192.168.0.253

Non-authoritative answer:
Name:    whitehouse.gov
Addresses:  2a02:26f0:60:298::2add
          2a02:26f0:60:29a::2add
          23.207.177.41
nslookup www.eduskunta.fi
C:\Users\sahka>nslookup www.eduskunta.fi
Server:  raspberrypi
Address:  192.168.0.253

Non-authoritative answer:
Name:    www.eduskunta.fi
Address:  217.71.145.65

DNS terminology

DNS is rid of very conflicting terminology (as all of Information Technology field).

Term Meaning
Client An operating system requesting Domain Name lookups (DNS Queries) for a certain domain/ip address
Domain An given name for a network (typically consisting of multiple subnets) e.g. jamk.fi - these are sometimes called zones
Top Level Domain - TLD .fi, .com, .net, the typical endings of any webpage - complete list here
Root Servers Span across multiple countries and are strictly regulated by IANA - Locations can be browsed
Resolver A server collecting DNS Queries from clients and forwarding them to Authorative Name Servers
Authorative Name Servers Have the actual database of records for the domain
Records Data pairs (www, IPv4 address)
FQDN Fully Qualified Domain Name - complete record e.g. "student.labranet.jamk.fi."
DNS Server (of a company) Might be a Resolver and an Authorative Name Server at the same time

Records can themselves have different meaning:

Record Meaning
A IPv4 address (e.g. 8.8.8.8)
AAAA IPv6 address (e.g. 2001:4860:4860::8888)
NS Domain name of the name server (e.g. dns.google)
CNAME Canonical name for the domain name (jamk.fi -> redirects to -> www.jamk.fi)
MX Mail eXchanger, email for this domain should be sent here (e.g. postmaster@jamk.fi)
PTR name for an IP address (reverse record)

Example of a DNS query

The figure below shows the DNS activity of opetussuunnitelmat.peppi.jamk.fi.

!a

Note that only one dns query (1) & dns query response (8) can be seen on the client workstation

You would have to wireshark the resolver to get the details of the query visible.

DNS Query (1)

!a

DNS Query response (8)

!a

How to do DNS in the course

Setting up a Full DNS Server is a task too laborous for this course.

Instead we use our local database in Lubuntu to install names for ip addresses.

This is handled through the file /etc/hosts.

!a

It can be modified by the command sudo nano /etc/hosts

  1. sudo nano /etc/hosts
  2. writing necessary rows (<ip> <name>)
  3. Press: CTRL+X
  4. Press: Y
  5. Press: Enter

The file is now saved and used by the local Lubuntu.

The same names do not work on other Lubuntu's, their hosts file has to be updated separately

The Lubuntu isn't a DNS Server.

If you wish to explore further you can look at DNS Server Software

Once /etc/hosts is modified you can use the DNS names on your local computer.

nslookup sw1.karo.saharinen

!a

ping sw1.karo.saharinen

!a

This hosts file is actually the way they did DNS in ~1985 - 1990.

RFC 1034 - DOMAIN NAMES - CONCEPTS AND FACILITIES - 1987

The impetus for the development of the domain system was growth in the Internet:

Host name to address mappings were maintained by the Network Information Center (NIC) in a single file (HOSTS.TXT) which was FTPed by all hosts [RFC-952, RFC-953]. The total network bandwidth consumed in distributing a new version by this scheme is proportional to the square of the number of hosts in the network, and even when multiple levels of FTP are used, the outgoing FTP load on the NIC host is considerable. Explosive growth in the number of hosts didn't bode well for the future.

So if you wish, you can write the hosts file once and distribute it to all other Lubuntu's in your environment. Remember to do it periodically if you have updated the contents of the main hosts file!

Continue to the Exercises

E15 Configuring Basic DNS Functionality

Back to the Schedule?

Back to the Course Schedule


License

This course and its materials are written by Karo Saharinen and licenced by Attribution-NonCommercial-NoDerivatives 4.0 International (CC BY-NC-ND 4.0) license.

Creative Commons -licence